package net.minecraft.src;

import java.util.ArrayList;

import net.minecraft.src.forge.IShearable;

public class EntityMooshroom extends EntityCow implements IShearable
{
    public EntityMooshroom(World world)
    {
        super(world);
        texture = "/mob/redcow.png";
        setSize(0.9F, 1.3F);
    }

    public boolean interact(EntityPlayer entityplayer)
    {
        ItemStack itemstack = entityplayer.inventory.getCurrentItem();
        if (itemstack != null && itemstack.itemID == Item.bowlEmpty.shiftedIndex && getDelay() >= 0)
        {
            entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, new ItemStack(Item.bowlSoup));
            return true;
        }
        return super.interact(entityplayer);
    }

    protected EntityAnimal spawnBabyAnimal(EntityAnimal entityanimal)
    {
        return new EntityMooshroom(worldObj);
    }

    @Override
    public boolean isShearable(ItemStack item, World world, int X, int Y, int Z) 
    {
        return getDelay() >= 0;
    }

    @Override
    public ArrayList<ItemStack> onSheared(ItemStack item, World world, int X, int Y, int Z, int fortune) 
    {
        setEntityDead();
        EntityCow entitycow = new EntityCow(worldObj);
        entitycow.setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch);
        entitycow.setEntityHealth(getEntityHealth());
        entitycow.renderYawOffset = renderYawOffset;
        worldObj.spawnEntityInWorld(entitycow);
        worldObj.spawnParticle("largeexplode", posX, posY + (double)(height / 2.0F), posZ, 0.0D, 0.0D, 0.0D);
        
        ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
        for (int x = 0; x < 5; x++)
        {
            ret.add(new ItemStack(Block.mushroomRed));
        }
        return ret;
    }
}
